import React from 'react';
import styles from './TodoItem.css';

function TodoItem(A) {
   // console.log(props)
  let {todo}=A
  return (
    <li onClick={()=>{
      A.dispatch({type:'todos/toggle', id:A.todo.id})
    }} className={A.todo.completed? styles.completed : styles.active}>
      {todo.text}
    </li>
  );
}

export default TodoItem;
